<template>
	<view class="zljc-container">
		<topNav
			class="home-top"
			title="质量检查 "
			:isUnderline="true"
			backgroundColor="#fe689b"
			color="#ffffff"
            :isCustomBackEvent="true"
			@backCallback="backCallback"
		></topNav>
		<view class="info-box">
			<view class="info-title">质量检查表</view>
			<view class="info-other">
				<view class="info-rows">
					<view class="info-label">时间</view>
					<view class="info-colon">：</view>
					<view class="info-text">{{ info.time }}</view>
				</view>
				<view class="info-rows">
					<view class="info-label">状态</view>
					<view class="info-colon">：</view>
					<view class="info-text">{{ info.status }}</view>
				</view>
				<view class="info-rows">
					<view class="info-label">计划数</view>
					<view class="info-colon">：</view>
					<view class="info-text">{{ info.planNum }}</view>
				</view>
			</view>
		</view>
		<view class="type-box">
			<u-tabs
				lineColor="#f56c6c"
				:activeStyle="{
					color: '#fe689b',
					fontWeight: 'bold',
					transform: 'scale(1.05)',
				}"
				:inactiveStyle="{
					color: '#000000',
					transform: 'scale(1)',
				}"
				:list="typeList"
				@click="typeClick"
			></u-tabs>
		</view>
		<view class="list-content">
			<scroll-view
				class="list-container"
				scroll-y="true"
				@scroll="scroll"
				:style="'height:' + listHeight + 'px;'"
			>
				<view
					class="list-item"
					v-for="(item, index) in list"
					:key="index"
					@click="listClick(item)"
				>
					<view class="list-left">
						<view class="list-title">{{ item.title }}</view>
						<view class="list-time">{{ item.time }}</view>
					</view>
					<view class="list-right">
						<view class="list-status">{{ item.status }}</view>
					</view>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
import { mapState } from "vuex";
export default {
	data() {
		return {
			info: {
				time: "2020.07.24-2022.10.02",
				status: "进行中",
				planNum: 31, // 假数据，请根据实际返回数据修改
			},
			typeList: [
				{
					name: "计划列表",
					value: "1",
				},
				{
					name: "考核要求",
					value: "2",
				},
			],
			scroll: 0,
			list: [
				{
					id: 1,
					title: "（康复医学科）质量普查检表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
				{
					id: 2,
					title: "（消毒供应中心）护理质量检查表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
				{
					id: 3,
					title: "苏醒室质量检查表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
				{
					id: 4,
					title: "（血透室）护理质量管理检查检表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
				{
					id: 5,
					title: "（新生儿室）质量查检表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
				{
					id: 6,
					title: "产房护理管理质量查检表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
				{
					id: 7,
					title: "内镜室护理管理质量查检表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
				{
					id: 8,
					title: "（急诊抢救室）护理质量查检表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
				{
					id: 9,
					title: "急诊预检分诊护理质量查检表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
				{
					id: 1,
					title: "（康复医学科）质量普查检表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
				{
					id: 2,
					title: "（消毒供应中心）护理质量检查表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
				{
					id: 3,
					title: "苏醒室质量检查表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
				{
					id: 4,
					title: "（血透室）护理质量管理检查检表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
				{
					id: 5,
					title: "（新生儿室）质量查检表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
				{
					id: 6,
					title: "产房护理管理质量查检表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
				{
					id: 7,
					title: "内镜室护理管理质量查检表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
				{
					id: 8,
					title: "（急诊抢救室）护理质量查检表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
				{
					id: 9,
					title: "急诊预检分诊护理质量查检表",
					time: "2020.07.26 15:00 ~ 2021.07.26 15:00",
					status: "进行中",
				},
			],
		};
	},
	methods: {
		backCallback() {
			uni.switchTab({
				url: "/pages/index/index",
			});
		},
		typeClick(item) {},
		listClick(item) {
			uni.navigateTo({
				url: `/pages/index/zljc/chooseRoom?id=${item.id}&title=${item.title}&time=${item.status}`,
			});
		},
	},
	computed: {
		...mapState({
			listHeight: (state) => {
				return (
					state.systemInfo.screenHeight -
					(state.systemInfo.top_topNav +
						uni.upx2px(216) +
						uni.upx2px(90) +
						uni.upx2px(16))
				);
			},
		}),
	},
};
</script>

<style lang="scss" scoped>
.zljc-container {
	background-color: #f7f7f7;
	.info-box {
		background-color: #ffffff;
		color: #000000;
		height: 216rpx;
		.info-title {
			font-weight: bold;
			padding: 16rpx 48rpx;
			border-bottom: 2rpx solid rgba(0, 0, 0, 0.1);
		}
		.info-other {
			padding: 16rpx 32rpx;
			.info-rows {
				display: flex;
				display: flex;
				font-size: 24rpx;
				line-height: 36rpx;
			}
		}
	}
	.type-box {
		background-color: #ffffff;
		margin-top: 16rpx;
		border-bottom: 2rpx solid rgba(0, 0, 0, 0.1);
	}
	.list-content {
		.list-container {
			.list-item {
				background-color: #ffffff;
				padding: 16rpx 32rpx;
				border-bottom: 2rpx solid rgba(0, 0, 0, 0.1);
				display: flex;
				justify-content: space-between;
				.list-left {
					.list-title {
						color: #000000;
						font-size: 28rpx;
						font-weight: 500;
					}
					.list-time {
						font-size: 20rpx;
						color: #7d7d7d;
						margin-top: 8rpx;
					}
				}
				.list-right {
					font-size: 24rpx;
					line-height: 74rpx;
					.list-status {
						color: #68af53;
					}
				}
			}
		}
	}
}
</style>
